<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>openid.oidutil</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="openid-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://openidenabled.com/python-openid/">Python-OpenID</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="openid-module.html">Package&nbsp;openid</a> ::
        Module&nbsp;oidutil
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="openid.oidutil-module.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF MODULE DESCRIPTION =========== -->
<h2 class="module">Module openid.oidutil</h2>

<p>This module contains general utility code that is used throughout the 
library.</p>
For users of this library, the <code><a 
href="openid.oidutil-module.html#log" 
class="link"><code>log</code></a></code> function is probably the most 
interesting.
<hr/>

<!-- =========== START OF FUNCTION SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Function Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">        str
</font></td>
  <td><code><span class="summary-sig"><a href="openid.oidutil-module.html#appendArgs" class="summary-sig-name"><code>appendArgs</code></a>(<span class=summary-sig-arg>url</span>,
          <span class=summary-sig-arg>args</span>)</span></code>
<br />
Append query arguments to a HTTP(s) URL.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><a name="fromBase64"></a><span class="summary-sig"><span class="summary-sig-name">fromBase64</span>(<span class=summary-sig-arg>s</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="openid.oidutil-module.html#log" class="summary-sig-name"><code>log</code></a>(<span class=summary-sig-arg>message</span>,
          <span class=summary-sig-arg>level</span>)</span></code>
<br />
Handle a log message from the OpenID library.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="openid.oidutil-module.html#toBase64" class="summary-sig-name"><code>toBase64</code></a>(<span class=summary-sig-arg>s</span>)</span></code>
<br />
Represent string s as base64, omitting newlines</td></tr>
</table><br />


<!-- =========== START OF FUNCTION DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Function Details</th></tr>
</table>

<a name="appendArgs"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">appendArgs</span>(<span class=sig-arg>url</span>,
          <span class=sig-arg>args</span>)</span>
  </h3>
  Append query arguments to a HTTP(s) URL. If the URL already has 
  query arguemtns, these arguments will be added, and the existing 
  arguments will be preserved. Duplicate arguments will not be detected 
  or collapsed (both will appear in the output).
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>url</b></code> -
         The url to which the arguments will be appended
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=str)</i>
      <dd><code><b>args</b></code> -
         The query arguments to add to the URL. If a dictionary is 
        passed, the items will be sorted before appending them to the 
        URL. If a sequence of pairs is passed, the order of the sequence 
        will be preserved.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=A dictionary from string to string, or a sequence of 
              pairs of strings.)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        The URL with the parameters added
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=str)</i>
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="log"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">log</span>(<span class=sig-arg>message</span>,
          <span class=sig-arg>level</span>=<span class=sig-default>0</span>)</span>
  </h3>
  <p>Handle a log message from the OpenID library.</p>
  <p>This implementation writes the string it to <code>sys.stderr</code>, 
  followed by a newline.</p>
  <p>Currently, the library does not use the second parameter to this 
  function, but that may change in the future.</p>
  To install your own logging hook:
<pre class="literalblock">
 from openid import oidutil

 def myLoggingFunction(message, level):
     ...

 oidutil.log = myLoggingFunction
</pre>
  <dl><dt></dt><dd>
    <dl><dt><b>Parameters:</b></dt>
      <dd><code><b>message</b></code> -
         A string containing a debugging message from the OpenID 
        library
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=str)</i>
      <dd><code><b>level</b></code> -
         The severity of the log message. This parameter is currently 
        unused, but in the future, the library may indicate more 
        important information with a higher level value.
        <br /><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        (type=int or None)</i>
      </dd>
    </dl>
    <dl><dt><b>Returns:</b></dt>
      <dd>
        Nothing.
      </dd>
    </dl>
  </dd></dl>
</td></tr></table>

<a name="toBase64"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">toBase64</span>(<span class=sig-arg>s</span>)</span>
  </h3>
  Represent string s as base64, omitting newlines
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="openid-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://openidenabled.com/python-openid/">Python-OpenID</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Fri Dec 14 16:10:53 2007</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
